package com.wf.course.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.utils.page.PageBean;
import com.wf.course.dao.IChapterPlayRecordMapper;
import com.wf.course.model.course.ChapterPlayRecord;
import com.wf.course.service.IChapterPlayRecordService;

@Service
@Transactional(rollbackFor=Exception.class)
public class IChapterPlayRecordServiceImpl implements IChapterPlayRecordService{
	
	@Autowired
	private IChapterPlayRecordMapper mapper;

	@Override
	public void indexInfo(PageBean<ChapterPlayRecord> pageBean) {
		// TODO Auto-generated method stub
//		pageBean.setResults(this.mapper.queryList(pageBean));
//		pageBean.setTotalCount(this.mapper.getTotalCount(pageBean));
		pageBean.setResults(this.mapper.getPlayCount(pageBean));
		pageBean.setTotalCount(this.mapper.getPlayTotalCount(pageBean));
	}

	@Override
	public void saveChapterPlayRecordOrUpdate(ChapterPlayRecord chapterPlayRecord) {
		// TODO Auto-generated method stub
		this.mapper.saveChapterPlayRecord(chapterPlayRecord);
	}

	@Override
	public ChapterPlayRecord querChapterPlayRecordById(Integer id) {
		// TODO Auto-generated method stub
		return this.mapper.queryChapterPlayRecordById(id);
	}

	@Override
	public void deleteById(Integer id) {
		// TODO Auto-generated method stub
		this.mapper.deleteById(id);
	}

 
	
}
